/*
 * Copyright (c) 2007-2021 西安交通信息投资营运有限公司 版权所有
 */

package com.xci.xajtfb.bus.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.github.lvyanyang.core.BaseEntity;
import com.github.lvyanyang.core.Const;
import com.github.lvyanyang.core.IUser;
import com.github.lvyanyang.validator.IdCard;
import com.github.lvyanyang.validator.MobilePhoneNumber;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

import java.util.Date;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 小程序用户表
 * @author 吕艳阳 lvyanyang@xci96716.com
 * @since 2021-03-03 17:35:58
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(description = "小程序用户表")
public class WxMember extends BaseEntity {
    /**
     * 用户主键
     */
    @ExcelIgnore
    @Excel(name = "用户主键", width = 20d)
    @ApiModelProperty(value = "用户主键", position = 1)
    private String userid;

    /**
     * 联系电话
     */
    @MobilePhoneNumber
    @NotBlank(message = "联系电话不能为空")
    @Length(max = 11, message = "联系电话长度不能超过{max}个字符")
    @Excel(name = "联系电话", width = 20d)
    @ApiModelProperty(value = "联系电话", required = true, position = 2)
    private String phone;

    /**
     * 姓名
     */
    @NotBlank(message = "姓名不能为空")
    @Length(max = 50, message = "姓名长度不能超过{max}个字符")
    @Excel(name = "姓名", width = 20d)
    @ApiModelProperty(value = "姓名", required = true, position = 3)
    private String name;

    /**
     * 身份证号码
     */
    @IdCard
    @Length(max = 18, message = "身份证号码长度不能超过{max}个字符")
    @Excel(name = "身份证号码", width = 20d)
    @ApiModelProperty(value = "身份证号码", position = 4)
    private String idcard;

    /**
     * 联系地址
     */
    @Length(max = 100, message = "联系地址长度不能超过{max}个字符")
    @Excel(name = "联系地址", width = 20d)
    @ApiModelProperty(value = "联系地址", position = 5)
    private String address;

    /**
     * 电子邮件
     */
    @Length(max = 50, message = "电子邮件长度不能超过{max}个字符")
    @Excel(name = "电子邮件", width = 20d)
    @ApiModelProperty(value = "电子邮件", position = 6)
    private String email;

    /**
     * 微信openid
     */
    @NotBlank(message = "微信openid不能为空")
    @Length(max = 50, message = "微信openid长度不能超过{max}个字符")
    @Excel(name = "微信Id", width = 20d)
    @ApiModelProperty(value = "微信Id", position = 7)
    private String wechatid;

    /**
     * 注册时间
     */
    @Excel(name = "注册时间", width = 20d, exportFormat = Const.DEFAULT_DATETIME_PATTERN)
    @ApiModelProperty(value = "注册时间", position = 8)
    private Date registereddate;

    /**
     * 验证码
     */
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "验证码")
    private String phoneCaptcha;

    /**
     * 验证码序号
     */
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "验证码序号")
    private String serialNumber;

    /**
     * 用户token
     */
    @ApiModelProperty(value = "用户token")
    private String token;
}